#include "webui/JSON.h"

#include <boost/foreach.hpp>

namespace webui {

std::string JSON::get_json() const
{
	std::string r="{";	
	BOOST_FOREACH( const map_ss_t::value_type& it, map_ )
		r+= '"'+it.first+"\":\""+it.second+"\",";
	r[r.size()-1]='}'; // replace , at end of list
	return r;
}

} // namespace webui

namespace boost {

template<>
std::string lexical_cast<std::string>(const webui::JSON& json)
{
	return json.get_json();
}

} // namespace boost
